# Python 运算和流程控制循环
"""
布尔值
Ture
False
"""
print(True and True)
print(not True)

a = 12
b = 13
print(a == b)
print(a != b)
print(a > b)
print(a < b)
print(a >= b)
print(a <= b)
"""
逻辑运算符执行顺序
 not > and > or
 闰年算法（能被4整除不能被100整除,能被400整除）
"""
year = 1999
if year % 400 == 0:
    print("{}是闰年".format(year))
else:
    if year % 4 == 0:
        if year % 100 == 0:
            print(str(year) + " 不是闰年")
        else:
            print(str(year) + " 是闰年")
    else:
        print(str(year) + " 不是闰年")
print("--------------另外做法-----------------")
year1 = 1000
if year1 % 400 == 0 and year1 % 100 != 0 or year1 % 400 == 0:
    print("{}是闰年".format(year1))
else:
    print(str(year1) + " 不是闰年")
"""
for 循环
"""
print("--------------for 循环 01 -----------------")
for i in range(10):
    print(i, end="-")
print("--------------for 循环 02 -----序列解包赋值------------")
list1 = {(1, 2), (3, 4), (5, 6)}
for i, j in list1:
    print("i:{},j:{}".format(i, j))
print("--------------for 循环 03-----嵌套循环------------")
'''
1*1=1
1*2=2 2*2=4
1*3=3 2*3=6 3*3=9
'''
for i in range(1, 10):
    for j in range(1, i + 1):
        print("{}x{}={}".format(j, i, i * j), end=" ")
    print("\n")
"""
while 循环
"""
num1 = 1
while num1 < 5:
    num1 += 1
    print(num1)
else:
    print("over")
"""
流程控制次
pass continue break
"""
for i in "hello word":
    if i == "w":
        pass
        break
    print(i)
